Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments to protobuf files about specifying ledgers #3398

Closed
wants to merge 1 commit into from

Conversation

cjcobb23
Copy link
Contributor

@cjcobb23 cjcobb23 commented May 12, 2020

Specifying a ledger has a lot of gotchas. For GetTransaction, the ledger range is only used for error handling, and searched_all is part of the error message, as opposed to the protobuf response. For GetAccountInfo, SHORTCUT_VALIDATED returns the most up to date data; however, using SHORTCUT_VALIDATED for GetAccountTransactionHistory results in only transactions from the most recently validated ledger being returned. I added some comments to point out these nuances more clearly.


This change is Reviewable

@cjcobb23
Copy link
Contributor Author

Requested the devx people for review, since they pointed this out.

Stormtv
Stormtv previously approved these changes May 12, 2020
Copy link
Collaborator

@mDuo13 mDuo13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know enough about the gRPC details to really validate whether these statements are true. However, they make sense to me.

@cjcobb23
Copy link
Contributor Author

cjcobb23 commented May 12, 2020

@mDuo13 gRPC and the JSON API use the same code underneath. If the comments are true for JSON, they are true for gRPC.

Edit: they use the same code for tx and account_tx, but account_info is a different codepath

keefertaylor
keefertaylor previously approved these changes May 13, 2020
Copy link

@keefertaylor keefertaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look reasonable to me but I'd wait for Amie's review as well since she's been closer to the metal here.

amiecorso
amiecorso previously approved these changes May 13, 2020
Copy link

@amiecorso amiecorso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny nit but otherwise this is clear to me and agrees with the behavior I've observed WRT various configurations of ledger specifiers/ranges in gRPC calls from the SDKs. Thanks CJ!

@@ -23,7 +23,11 @@ message GetTransactionRequest {
// if true, return data in binary format. defaults to false
bool binary = 2;

// search only specified range. optional
// If the transaction is not found, server will report whether the entire
// specified range is searched. The value is contained in the error message.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might change "is" to "was"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to was

@cjcobb23
Copy link
Contributor Author

@amiecorso @Stormtv can you approve this if it looks good?

@cjcobb23 cjcobb23 added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label May 28, 2020
@amiecorso amiecorso self-requested a review June 24, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants